﻿@model IEnumerable<WarFrota.Models.Veiculo>

@{
    ViewBag.Title = "Listagem de Veículos";
}

<h2>Veículos</h2>

<p>
    @Html.ActionLink("Novo", "Create")
</p>
<table>
    <tr>
        <th>
            Placa
        </th>
        <th>
            Modelo
        </th>
        <th>
            Data da Compra
        </th>
        <th>
            KM Atual
        </th>
        <th>
            Consumo(KM\Litro)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Placa)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Modelo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DataCompra)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.KMAtual)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Consumo)
        </td>
        <td>
            @Html.ActionLink("Alterar", "Edit", new { placa=item.Placa }) |
            @Html.ActionLink("Detalhes", "Details", new { placa=item.Placa }) |
            @Html.ActionLink("Excluir", "Delete", new { placa=item.Placa })
        </td>
    </tr>
}

</table>
